package com.cunshe.web.manage;

import com.cunshe.common.ResponseVO;
import com.cunshe.config.annotation.Login;
import com.cunshe.domain.EmailAddress;
import com.cunshe.service.EmailAddressService;
import com.sunkee.entity.page.Pageable;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "订阅用户")
@Login
@RestController
@RequestMapping(value = "/manage/emailAddress")
public class EmailAddressController {

    @Autowired
    private EmailAddressService emailAddressService;

    @ApiOperation(value = "分页查询")
    @PostMapping(value = "pagelist")
    public ResponseVO<Pageable<EmailAddress>> pagelist(@RequestParam("pageNo") int pageNo, @RequestParam("pageSize") int pageSize, String email) {
        Pageable<EmailAddress> pagelist = emailAddressService.pagelist(pageNo, pageSize, email);
        return ResponseVO.success(pagelist);
    }

}